
#from sqlalchemy import Column,Integer, String, create_engine
from sqlalchemy import *
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql.elements import BinaryExpression
from SqlData.Repository import *
import types

# 创建实体对象基类
Base = declarative_base()

#用户实体类
class EntityUser(Base):
    __tablename__ = "oc_user"

    user_id = Column(String(50),primary_key=True)
    user_name = Column(String(50))
    user_pwd = Column(String(50))
    real_name = Column(String(50))
    user_sex = Column(Integer)
    user_role = Column(Integer)
    user_phone = Column(String(50))
    is_enabled = Column(Integer)
    remark = Column(String(500))

#试验信息实体类
class EntityExperiment(Base):
    __tablename__ = "oc_experiment"

    experiment_id = Column(String(50),primary_key=True)
    experiment_user_id = Column(String(50))
    experiment_user_name = Column(String(50))
    experiment_type = Column(Integer)
    material_name = Column(String(50))
    muju_type = Column(Integer)
    test_juli = Column(Float)
    dianhuo_type = Column(Integer)
    dianhuo_time = Column(Integer)
    start_frame = Column(Integer)
    end_frame = Column(Integer)
    description = Column(String(50))
    result = Column(String(50))
    start_time = Column(String(50))
    end_time = Column(String(50))
    total_cost = Column(Integer)
    is_visible = Column(Integer)

#试验记录信息实体类
class EntityExperimentRecord(Base):
    __tablename__ = "oc_experiment_record"

    record_id = Column(String(50),primary_key=True)
    experiment_step_id = Column(String(50))
    experiment_id = Column(String(50))
    temp_value = Column(Float)
    light_value = Column(Float)
    record_time = Column(String(50))





